home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / 3DLIB11.ARJ / 3DLIB.DOC < prev    next >
Text File  |  1992-03-19  |  13KB  |  248 lines

  1.  
  2.  ╔══════════════════════════════════════════════════════════════════════════╗
  3.  ║                                                                          ║
  4.  ║                                 ISoft D&M                                ║
  5.  ║                                 POB. 5517                                ║
  6.  ║                           Coralville IA 52241                            ║
  7.  ║                                   U.S.A                                  ║
  8.  ║                                                                          ║
  9.  ╚══════════════════════════════════════════════════════════════════════════╝ 
  10.  
  11. *******************************************************************************
  12. *                                    3dLIB                                    *
  13. * 3dLIB - 3D Graphic objects library for Turbo-Pascal Programmers. V1.1       *
  14. * Last Update : Mar. 19, 1992.                                                *
  15. *******************************************************************************
  16.  
  17.                                  FILE - LIST
  18.                                  -----------
  19.  
  20.   The distribution file 3DLIB11 contains the following files :
  21.  
  22.         *     .PAS      - Pascal sources :
  23.                           CTM     .PAS - Current Transformation Matrix definition
  24.                           PROJECT3.PAS - Projection (3D -> 2D) unit
  25.                           HDR3D   .PAS - Header to 3D structures
  26.                           RTOBJ   .PAS - 3D Wire-Mesh objects
  27.                           DEMO3d  .PAS - A demo program.
  28.         *     .TPU      - Complied Units.
  29.         *     .3D2      - Demo OBJ3D Type object files :
  30.                           3       .3D2 - A 3 dimentional "3" character.
  31.                           BOX     .3D2 - A 3D box.
  32.                           D       .3D2 - A 3 dimentional "d" character.
  33.                           PROP    .3D2 - A 3D Propelor.
  34.                           PYR     .3D2 - A Pyramide.
  35.                           SUPROP  .3D2 - Another 3D Propelor.
  36.                           TRAP    .3D2 - A 3D Trapez.
  37.         *     .3DS      - Demo ComplexObj type object files.
  38.         3DLIB .DOC      - This file.
  39.         3DC   .EXE      - M3D to PAS source file translator.
  40.         3DC   .DOC      - 3dC translator documentation.
  41.         *     .M3D      - Sample macro programs.
  42.         DEMO3D.EXE      - Demo 3d animation program.
  43.         PROGRAMS.TXT    - ISoft D&M shareware products description.
  44.         3DLIB .REG      - 3dLIB registration file.
  45.  
  46.  
  47.                                  Why Register
  48.                                  ------------
  49.  
  50.   3dLIB is a shareware product, if you find this product valuable, 
  51.  please register it. This section describes the reasones you should register.
  52.  
  53.   By registering you will receive a printed manual, with many examples, a 
  54.  diskette with the latest 3dLIB version, and the complete source code for 3dLIB
  55.  based training and example programs, and - you will help us to create the next 
  56.  version of 3dLIB - that will include even more features then the features that 
  57.  are currently available!,  we might even add YOUR enhancment requests!
  58.  
  59.                                  INTRODUCTION
  60.                                  ------------
  61.  
  62.   3dLIB is a library of pascal units that allows Turbo-Pascal programmers to                                 
  63.  write applications that display and animate 3D wire-mesh objects. The 
  64.  library is based on a project developed since 1984 on different platforms.
  65.  
  66.   A package called 3D111 is distributed by ISoft D&M that 
  67.  includes a graphic editor, macro interpreter and pascal translator to
  68.  create and use 3D objects. It is highly recomended that any programmer
  69.  tring to use this library will use the 3D program to create 
  70.  objects, and understand the animation abilities of the library.
  71.  
  72.                                    OBJECTS
  73.                                    -------
  74.   The 3D objects are defined as the following TP object-structures :
  75.   
  76. *******************************************************************************
  77. *                                 BaseObject                                  *
  78. *******************************************************************************
  79.  baseObject - defined in the RTOBJ.PAS file, this is the "dummy"
  80.  ancestor object class of the 3D-objects, such an object has a CTM (called
  81.  myCTM), a color, a center of gravity 3D point (location), and other display
  82.  attributes, in order to achieve better animation results, a scrPntUpdt 
  83.  boolean variable is used to indicate if the screen 2D points of the
  84.  object has to be re-calculated from the 3D represantation.                       
  85.   
  86.   The object uses a 4X4 "transformation matrix" to represent itself in the
  87.  3D universe, the move, translate, scale, allScale, rotate, goto3dPos,
  88.  setToOrigin, calcLocation and deleteTransform methods are used to update
  89.  that matrix (the Current Transformation Matrix).
  90.  
  91.   The load, save, writeMe, and readMe methods are used to strore and retrieve
  92.  a 3D object from a storage device (a disk..), and the open and close methods
  93.  are used to construct, and destruct the object. The show, hide and paint
  94.  methods display, or erase the object on the 2D screen. One more interesting
  95.  method is the updateScreenPoints method, that transforms the 3D object 
  96.  representation to the 2D screen.
  97.  
  98. *******************************************************************************
  99. *                                    obj3D                                    *
  100. *******************************************************************************
  101.   obj3D is a descendant object of the baseObject class, this is a simple
  102.  wire-mesh object, that is built from an array of maxPoints points (change
  103.  this constant in the HDR3D.PAS file to create bigger, or smaller objects)
  104.  in the 3D universe, an array of maxLines lines (a line is a segment in the
  105.  3D universe that connects 2 3D points), another array holds the 2D screen
  106.  points of the object, calculated from its 3D represantation, and the CTM.
  107.  Another interesting aspect of this object is the use of 2 more matrixes,
  108.  the reverseRot, and unReverseRot CTM objects, that are used to hold only the
  109.  reverse, and counter reverse of the rotation transformations, these are used
  110.  by complex objects that contain several obj3D objects, where some of them 
  111.  has to be rotated, scaled and translated around an arbitrary point in the
  112.  3D universe, which is not there center of gravity (frame - reference).
  113.  
  114. *******************************************************************************
  115. *                                 complexObj                                  *
  116. *******************************************************************************
  117.   The RTOBJ.PAS file contains the definition of the complexObj 3D object,
  118.  this is an object that contains a maxSubObjects (defined in that file)
  119.  array of simple wire-mesh obj3D objects. This object class sometimes
  120.  refered to as the "super - object", allows the user to create complex 3D
  121.  objects that has a common frame - reference (center of gravity), an example
  122.  of such an object might be a Robot, that has a center of gravity, and is
  123.  built of some sub objects that must be able to be transformed both with the
  124.  frame - reference, and by themselves.
  125.  
  126.   The RTOBJ.PAS (for - RunTime object) unit file contains the definition of
  127.  the baseObj, obj3D and the complexObj classes.
  128.  
  129.  
  130.                                   PROJECTIONS
  131.                                   -----------
  132.  
  133.   The PROJECT3.PAS file contain the code that transforms objects and points
  134.  from the 3D universe, to the 2D coordinates.
  135.  
  136.   Two 3D -> 2D transformations are supported, axonometric projection, and 
  137.  perspective projection. This is a short explanation of the difference
  138.  between these 2 projections :
  139.  
  140.                A : axonometric projections, no perspective due to        
  141.                        distance is performed, the general way            
  142.                        we can look at the coordinate system is as        
  143.                        follows :                                         
  144.                                                                          
  145.                                |  z axis                                 
  146.                                |                                         
  147.                               / \                                        
  148.                     x axis   /   \  y axis                               
  149.                                                                          
  150.                B : perspective projections : the normal eye perspective  
  151.                        projection is performed, we can look at the 3d    
  152.                        universe we are refering to as a cube of          
  153.                        1000 x 1000 x 1000 integer locations, with        
  154.                        the x axis, and y axis parallel to the screen     
  155.                        x, y axis respectivly, and the z axis going into  
  156.                        the screen.                                       
  157.                                                                          
  158.                        we will look at the coordinate system as follows :
  159.                                                                          
  160.                        │ Y axis                                          
  161.                        │                                                 
  162.                 Z axis x------ X axis                                    
  163.                                                                          
  164.   These units contain a calcPoint procedure that recieves a 3D point, and
  165.  transforms it to a 2D screen coordinate, the setPerspective, 
  166.  resetPerspective and togglePerspective change from perspective projection
  167.  to axonometric projection, and vice versa.
  168.  
  169.                                       CTM
  170.                                       ---  
  171.  
  172.   CTM3D.PAS is the file that defines the current transformation matrix that                                      
  173.  is used to position the 3D objects in the universe. The CTM is a 4x4 matrix
  174.  that is multiplied (from the right) by each point of the 3D object whenever
  175.  a new location is desired for the object. 
  176.  
  177.   This unit defines all the transformations that can be applied and used
  178.  by a CTM, like rotate, scale, translate etc..
  179.  
  180.                                   3D2 FORMAT
  181.                                   ----------
  182.  
  183.   The obj3D object files are files of type real, that has the following
  184.  structure :
  185.  
  186.  1 Real entry : number of 3D points. (We will call in numOfPoints)
  187.  numOfPoints entries that contain the following information :
  188.      1 Real Entry : X location in the 3D universe.
  189.      1 Real Entry : Y location in the 3D universe.
  190.      1 Real Entry : Z location in the 3D universe.
  191.  1 Real Entry : number of lines.  (We will call it numOfLines)
  192.  numOfLines entries that contain the following information :
  193.      1 Real Entry : 3D Point Number of "From" edge of the line.
  194.      1 Real Entry : 3D Point Number of "To" edge of the line.
  195.  
  196.  Please refer to the OBJ3D.README method that deals with reading this 
  197.  3D file format.
  198.  
  199.                                   3DS FORMAT
  200.                                   ----------
  201.  
  202.   The complexObj object files are files of real type that have the
  203.  following structure :
  204.  
  205.  1 Real Entry : Number of subobjects the complexObj contain (We will
  206.                  call it numOfChilds)
  207.  numOfChilds entries that have the same structure as simple 3D2 files.
  208.  
  209.                                    Warranty
  210.                                    --------
  211.  
  212.   There is no warranty what so ever, The program is supplied as is,
  213.  The distributer (ISoft D&M), or the author (Loewy Ron), are not,
  214.  and will not be responsible for any damages, lost profits, 
  215.  or inconveniences caused by the use, or inability to use this package. 
  216.  The use of the package is at your own risk. 
  217.  By using (or attempting to use) the package you agree to this.
  218.  
  219.                                     General
  220.                                     -------
  221.  
  222.   3dLIB is distributed by ISoft D&M, P.O.B. 5517 CORALVILLE IA 52241, U.S.A.
  223.   
  224.   3dLIB is (c) copyrighted by Loewy Ron, 1991, 92.
  225.  
  226.   3dLIB is a shareware package, please register your copy. 
  227.   To register your copy of 3dLIB please refer to the supplied
  228.   3DLIB.REG file. 
  229.  
  230.   Other programs distributed by ISoft D&M are described in the supplied  
  231.   PROGRAMS.TXT file.
  232.  
  233.                                     Contact
  234.                                     -------
  235.  
  236.   Please contact :
  237.  
  238.   ISoft D&M,  
  239.   P.O.B 5517
  240.   Coralville IA 52241,
  241.   U.S.A
  242.  
  243.                                     Credits
  244.                                     -------
  245.  
  246.   3dLIB was written using Turbo-Pascal V6.0, a copyright of 
  247.   Borland International.
  248.